<template>
  <div class="movie-info" v-if="props.movieInfo != null">
    <img :src="props.movieInfo.img + '?imageView2/1/w/300/h/414/q/80'" alt="props.movieInfo.movieName ">
    <div class="movie-desc">
      <div class="title line-ellipsis">{{ props.movieInfo.movieName }}</div>
      <div class="english-title line-ellipsis">{{ props.movieInfo.englishName }}</div>
      <div class="type line-ellipsis">{{ props.movieInfo.category }}</div>
      <div class="actors line-ellipsis">
        <!-- <ul>
          <li>李雪琴</li>
          <li>李雪琴</li>
          <li>李雪琴</li>
        </ul> -->
        {{ props.movieInfo.actors }}
      </div>
      <div class="pub line-ellipsis">{{ props.movieInfo.pubDesc }} / {{ props.movieInfo.duration }} 分钟</div>
      <div class="btns">
        <van-button hairline plain block size="small"><van-icon name="like" size="16" />想看</van-button> <van-button
          hairline plain block size="small"><van-icon name="star" size="16" />看过</van-button>
      </div>
    </div>
  </div>
</template>


<script setup>

const props = defineProps({
  movieInfo: {
    type: Object,
    default () {
      return {}
    }
  }
});

</script>

<style scoped>
.line-ellipsis {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
}


.movie-info {
  /* display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start; */
  margin-top: 10px;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: flex-start;
  color: #fff;
  margin-bottom: 10px;
}

.movie-info img {
  width: 100px;
  height: auto;
}


.movie-info .movie-desc {

  /* margin-left: 5px; */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  height: 100%;
  overflow: hidden;
}

.movie-info .movie-desc .title {
  font-size: 20px;
  height: 30px;
  line-height: 1;

}

.movie-info .movie-desc .english-title,
.movie-info .movie-desc .type,
.movie-info .movie-desc .actors,
.movie-info .movie-desc .pub {
  font-size: 12px;
  opacity: .6;

}





.movie-desc .btns {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;

}

.movie-desc .btns .van-button {
  background: hsla(0, 0%, 100%, .35);
  color: #fff;
}


.movie-desc .btns .van-button:last-child {
  margin-left: 20px;
  /* position: absolute;
  right: 0;
  top: 0; */
}

.van-icon {
  margin-right: 5px;
}
</style>
